package com.ubxtech.web.locale;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.ubxtech.web.properties.AuthProperties;

import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

/**
 * @author Victor.Xiao
 * @since 2023-09-15 11:46
 **/
public class CustomLocaleDateDeserializer extends JsonDeserializer<Date> {

    private AuthProperties authProperties;
    public CustomLocaleDateDeserializer(AuthProperties authProperties) {
        this.authProperties = authProperties;
    }
    @Override
    public Date deserialize(JsonParser p, DeserializationContext deserializationContext) throws IOException {
        return DateUtil.parse(p.getText());
    }

}